Attribute VB_Name = "Module1"
Public db As New ADODB.Connection
Public rs As New ADODB.Recordset
Public path As String
Public pathname As String

Public Sub ConnecDB()
    If db.State = 1 Then
        db.Close
    Else
        path = App.path & "\thuchimanager.mdb"
        db.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data source= " & path
    'db.Open
    
    End If
End Sub
Public Sub getDataView()
     On Error GoTo loi
    rs.Source = "select tblthanhvien.matv, tblchi.tentv, lydochi, khoanchi, ngaychi from tblchi, tblthanhvien where tblthanhvien.matv = tblchi.matv"
    rs.CursorType = adOpenDynamic
    rs.LockType = adLockOptimistic
    rs.Open
loi:
    'rs.Open
    MsgBox "Loi ket noi"
End Sub

